﻿//-----------------------------------------------------------------------------------
// WebTestRequest Plugin Template version 1.0
//-----------------------------------------------------------------------------------
using System;
using Microsoft.VisualStudio.TestTools.WebTesting;

namespace $rootnamespace$
{
    [System.ComponentModel.DisplayName("$itemname$")]
    [System.ComponentModel.Description("TODO: Add a more detailed description of $itemname$ extraction rule.")]
    public class $safeitemname$ : WebTestRequestPlugin
    {
        #region Constructors
        /// <summary>
        /// Default Constructor, remove if not needed
        /// </summary>
        public $safeitemname$()
        {
        }

        #endregion // Constructors

        #region Properties
/*
 * Public properties on the class will be surfaced to the user in the VS UI.
 * Only string, int, and bool types are allowed.
 */ 
/*
        /// <summary>
        /// Sample string property
        /// </summary>
        private string m_myStringProperty;
        [System.ComponentModel.DisplayName("My String Property")]
        [System.ComponentModel.Description("Enter a long description for this property.")]
        [System.ComponentModel.DefaultValue("MyString")]
        public string MyStringProperty
        {
            get { return m_myStringProperty; }
            set { m_myStringProperty = value; }
        }
*/
        #endregion //Properties

        #region Overrides
/*
 * To see a list of overridable methods type "public override " at the class scope.
 */

        /// <summary>
        /// Fires before each request
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void PreRequest(object sender, PreRequestEventArgs e)
        {
            // Access the request via e.Request property to modify the request before it is fired.

            // You can optionally control the execution of this request via 
            // the e.instruction property
            //
            //  e.Instruction = WebTestExecutionInstruction.Execute;
            //  e.Instruction = WebTestExecutionInstruction.Skip;
        }

        /// <summary>
        /// Fires after each request
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void PostRequest(object sender, PostRequestEventArgs e)
        {
            // You can override the outcome of the request in the post request.
        }
        #endregion // Overrides
    }
}